/*
 * // Bristleback plugin - Copyright (c) 2010 bristleback.googlecode.com
 * // ---------------------------------------------------------------------------
 * // This program is free software; you can redistribute it and/or modify it
 * // under the terms of the GNU Lesser General Public License as published by the
 * // Free Software Foundation; either version 3 of the License, or (at your
 * // option) any later version.
 * // This library is distributed in the hope that it will be useful,
 * // but without any warranty; without even the implied warranty of merchantability
 * // or fitness for a particular purpose.
 * // You should have received a copy of the GNU Lesser General Public License along
 * // with this program; if not, see <http://www.gnu.org/licenses/lgpl.html>.
 * // ---------------------------------------------------------------------------
 */

package pl.bristleback.server.bristle.token;

import org.jwebsocket.token.Token;

/**
 * Classes implementing this interface are responsible for adding parameters to token.
 * This interface does not determine details of this operation,
 * neither restricts which objects must or must not be able to be processed by specific tokenizer class.
 * Documentation of implementation should describe those details.
 * <p/>
 * Created on: 2010-12-16 14:28:50 <br/>
 *
 * @author Wojciech Niemiec
 */
public interface TokenizerEngine {

  /**
   * Adds values to token with names given in {@link Tokenize} annotation.
   *
   * @param token          a token to fill.
   * @param deepSearch     can be used to indicate that
   * @param parameterNames keys of token entries.
   * @param values         values to add.
   * @return It should be the token given as parameter, so method should return <code>this</code,
   *         to make chain invocation possible.
   */
  Token tokenize(Token token, boolean deepSearch, String[] parameterNames, Object[] values);
}
